package com.jcl.cloud.services.unicrawler.task;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jcl.cloud.services.gateway.common.task.BuyResumeReq;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

public class Test {

    public static void main(String[] args) {
        String src = "{\n" +
                "    \"code\": \"200\",\n" +
                "    \"msg\": \"OK\",\n" +
                "    \"type\": \"success\",\n" +
                "    \"data\": {\n" +
                "        \"curPage\": 1,\n" +
                "        \"total\": 1,\n" +
                "        \"rowSize\": 10,\n" +
                "        \"data\": [\n" +
                "            {\n" +
                "                \"password\": \"lc123456\",\n" +
                "                \"corpCode\": \"JCL0000001\",\n" +
                "                \"account\": null,\n" +
                "                \"username\": \"18516261250\"\n" +
                "            }\n" +
                "        ]\n" +
                "    }\n" +
                "}";




        if(StringUtils.isBlank(src)){
            return;
        }


        JSONObject srcJO = JSON.parseObject(src);

        JSONObject outDataJO = srcJO.getJSONObject("data");

        JSONArray inDataArr = outDataJO.getJSONArray("data");

        for(Object object : inDataArr){
            JSONObject jo = (JSONObject)object;

            Map map = JSON.toJavaObject(jo,Map.class);


            System.out.println(map.get("password"));
        }

    }
}
